/********************************************************
 Name          : led.h
 Author        : Karen Tsarukyan
 Copyright     : Copyright by Antel Systems
 Description   :
**********************************************************/


#ifndef _LED_H_
#define _LED_H_

//#include "PICO_CELL_01/PICO_CELL_01.h"

#define LED_ON                          1
#define LED_OFF                         0
#define PERIOD_400_MS                   0x1FF
#define PERIOD_200_MS                   0xFF
#define PERIOD_100_MS                   0x7F


enum Color {color_off, green, red, yellow };



enum LedName {alarm_status_grn, alarm_status_red,
              mode_grn, mode_red,
              state_grn, state_red,
              alarm_status, mode, state};

struct blink
{
	char Name[9];
	enum Color alarm_status_color1;
	enum Color alarm_status_color2;
	enum Color alarm_status_current_color;
	enum Color alarm_status_old_color;

	unsigned short alarm_status_grn_blink_period;
	unsigned short alarm_status_red_blink_period;
	unsigned short alarm_status_blink_period;

	enum Color mode_color1;
	enum Color mode_color2;
	enum Color mode_current_color;
	enum Color mode_old_color;

	unsigned short mode_grn_blink_period;
	unsigned short mode_red_blink_period;
	unsigned short mode_blink_period;



	enum Color state_color1;
	enum Color state_color2;
	enum Color state_current_color;
	enum Color state_old_color;

	unsigned short state_grn_blink_period;
	unsigned short state_red_blink_period;
	unsigned short state_blink_period;
};

enum Color alarm_status_color;

void led_init(void);

void led_mode_set_color(enum Color c);
void led_dual_mode_blink_start(enum Color c1, enum Color c2, unsigned short blink_period);
void led_dual_mode_blink_end(void);


void led_alarm_status_set_color(enum Color c);
void led_state_set_color(enum Color c);
void led_state_off(unsigned long long timeout);


void led_dual_state_blink_start(enum Color c1, enum Color c2, unsigned short blink_period);
void led_dual_state_blink_end(void);
void led_state_grn_blink_start(unsigned short blink_period);
void led_state_grn_blink_end(void);
void led_state_red_blink_start(unsigned short blink_period);
void led_state_red_blink_end(void);


#endif // _LED_H_
